home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992…ugust: Hack to the Future / ADC Developer CD (1992-08) (''Hack To The Future'')_iso / Dev.CD 199208.iso / Periodicals / develop / develop 9 code / EchoBox / 2BufRecordToBufCmd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-06  |  2.1 KB  |  70 lines  |  [TEXT/MPS ]

  1. /*______________________________________________________*/
  2. /*                      Sound I/O Demo                    */
  3. /*                          by                          */
  4. /*                  RICHARD P. COLLYER                  */
  5. /*              Developer Technical Support             */
  6. /*                 Apple Computer, Inc.                 */
  7. /*                       11/14/91                       */
  8. /*______________________________________________________*/
  9.  
  10. /**********************************/
  11. /* #includes                      */
  12. /**********************************/
  13.  
  14. #include    <Dialogs.h>
  15. #include    <GestaltEqu.h>
  16. #include    <Memory.h>
  17. #include    <OSEvents.h>
  18. #include    <Packages.h>
  19. #include    <Quickdraw.h>
  20. #include    <Sound.h>
  21. #include    <SoundInput.h>
  22. #include    <StdIO.h>
  23. #include    <Types.h>
  24. #include    <Windows.h>
  25.  
  26. /**********************************/
  27. /* #defines                          */
  28. /**********************************/
  29.  
  30. // Used as a macro to simplify one line of code. Use an exclusive OR to switch from 0 to 1, 
  31. // or from 1 to 0.  This is the index for our two buffer handle array
  32.  
  33. #define NextBuffer(x)                (x ^= 1)
  34.  
  35. //The number of Milliseconds of sound which is recorded before playback
  36. #define kMilliSecondsOfSound        1000
  37.  
  38. //Size of the top of the 'snd ' header
  39. #define    kBaseHeaderSize                6
  40.  
  41. //Multiplier to determine the size of the Synths in the header
  42. #define    kSynthSize                    6
  43.  
  44. //Multiplier to determine the size of the Cmds in the header
  45. #define    kCmdSize                    8
  46.  
  47. // Number of buffers being used
  48. #define    kNumberOfBuffers            2
  49.  
  50. // When building the SndHeader I use this constant to declare Middle C base Frequency
  51. #define    kMiddleC                    0x3C
  52.  
  53. // the error dialog for messages
  54. #define kErrorDialogID                128
  55.  
  56. // OK Button ID for the Error Handling Dialog
  57. #define    kOKButton                    1
  58.  
  59. // this is the static text item used to display the OSErr
  60. #define kErrNumStatText                5
  61.  
  62. // this is the static text item used to display a message to the user
  63. #define kMsgStatText                2
  64.  
  65. // nil used to open the default sound input driver
  66. #define    kDefaultDriver                nil
  67.  
  68. // estimate the largest 'snd ' header that we could imagine
  69. #define kEstimatedHeaderSize        (sizeof (SndListResource) + sizeof (ExtSoundHeader))
  70.